import i18n from '@/common/lang'

export const columns = [
  {
    label: i18n.t('financialSynergy.invoice.invoiceId'),
    width: 160,
    prop: 'number',
    fixed: true
  },
  {
    label: i18n.t('financialSynergy.invoice.supplierName'),
    width: 160,
    prop: 'supplierName',
    fixed: true
  },
  {
    label: i18n.t('financialSynergy.invoice.invoiceDate'),
    width: 130,
    prop: 'invoicingDate',
    fixed: true
  },
  {
    label: i18n.t('financialSynergy.invoice.invoiceType'),
    width: 'auto',
    minWidth: 130,
    prop: 'invoiceType'
  },
  {
    label: i18n.t('financialSynergy.invoice.invocieAmount'),
    width: 130,
    prop: 'amount'
  },

  {
    label: i18n.t('financialSynergy.invoice.creatBy'),
    width: 'auto',
    prop: 'createName'
  },
  {
    label: i18n.t('financialSynergy.invoice.ceratTime'),
    width: 170,
    prop: 'createTime'
  },
  {
    label: i18n.t('financialSynergy.invoice.state'),
    width: 100,
    prop: 'state'
  },
  {
    label: i18n.t('financialSynergy.invoice.payState'),
    width: 110,
    prop: 'payState'
  }
]

export const actions = [
  {
    key: 'edit',
    text: i18n.t('common.edit'),
    permissions: 'srm:invoiceNotice:edit'
  },
  {
    key: 'view',
    text: i18n.t('common.view'),
    permissions: 'srm:invoiceNotice:view'
  },
  {
    key: 'delete',
    text: i18n.t('common.delete'),
    permissions: 'srm:invoiceNotice:delete'
  },
  {
    key: 'send',
    text: i18n.t('common.send'),
    permissions: 'srm:invoiceNotice:publish'
  },
  {
    key: 'cancel',
    text: i18n.t('common.cancel'),
    permissions: 'srm:invoiceNotice:cancel'
  },
  {
    key: 'confirm',
    text: i18n.t('financialSynergy.invoice.sureInvoice'),
    permissions: 'srm:invoiceNotice:confirm'
  },
  {
    key: 'complte',
    text: i18n.t('financialSynergy.invoice.confirmInvoice'),
    permissions: 'srm:invoiceNotice:complete'
  }
]

export const conditions = {
  1: ['edit', 'view', 'delete', 'send'],
  2: ['view', 'cancel'],
  3: ['view', 'confirm'],
  4: ['view'],
  5: ['view'],
  6: ['view', 'complte'],
  7: ['view'],
  8: ['view']
}

// 对账明细列表

export const itemColumns = [
  // {
  //   label: i18n.t('financialSynergy.invoice.billId'),
  //   // minWidth: 140,
  //   width: 'auto',
  //   prop: 'billId',
  //   fixed: true
  // },
  {
    label: i18n.t('financialSynergy.invoice.billNumber'),
    // minWidth: 140,
    width: 'auto',
    prop: 'billNumber',
    fixed: true
  },
  {
    label: i18n.t('financialSynergy.invoice.billStartData'),
    // minWidth: 140,
    width: 'auto',
    prop: 'beginDate'
  },
  {
    label: i18n.t('financialSynergy.invoice.billEndDate'),
    // minWidth: 140,
    width: 'auto',
    prop: 'endDate',
    fixed: true
  },
  {
    label: i18n.t('financialSynergy.invoice.totalAmountNoTax'),
    // minWidth: 140,
    width: 'auto',
    prop: 'untaxedAmount'
  },
  {
    label: i18n.t('financialSynergy.invoice.totalAmountTax'),
    // minWidth: 140,
    width: 'auto',
    prop: 'totalAmount'
  }
]
export const itemAcitons = [
  {
    key: 'delete',
    text: i18n.t('common.delete')
    // permissions: 'upms:dict:update'
  }
]

// 对账单列表

export const billsColumns = [
  // {
  //   label: i18n.t('financialSynergy.invoice.billId'),
  //   // minWidth: 140,
  //   width: 'auto',
  //   prop: 'id',
  //   fixed: true
  // },
  {
    label: i18n.t('financialSynergy.invoice.billNumber'),
    // minWidth: 140,
    width: 'auto',
    prop: 'number',
    fixed: true
  },
  {
    label: i18n.t('financialSynergy.invoice.supplierName'),
    // minWidth: 140,
    width: 'auto',
    prop: 'supplierName',
    fixed: true
  },
  {
    label: i18n.t('financialSynergy.invoice.billStartData'),
    // minWidth: 140,
    width: 'auto',
    prop: 'beginDate'
  },
  {
    label: i18n.t('financialSynergy.invoice.billEndDate'),
    // minWidth: 140,
    width: 'auto',
    prop: 'endDate'
  },
  {
    label: i18n.t('financialSynergy.invoice.totalAmountNoTax'),
    // minWidth: 140,
    width: 'auto',
    prop: 'untaxedAmount'
  },
  {
    label: i18n.t('financialSynergy.invoice.totalAmountTax'),
    // minWidth: 140,
    width: 'auto',
    prop: 'totalAmount'
  }
]
export const billsActions = []
